<?php


namespace App\Http\Requests\ApiV2;

use App\Services\Business\Models\UserConquer;
use App\Services\Business\Models\WeightFragment;
use Illuminate\Support\Facades\Auth;

class PlanFragmentRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:120',

        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入标题'),
            'title.max' => __('课程标题的长度不能超过:size个字符', ['size' => 120]),

        ];
    }

    public function filldata()
    {

        return [
            'user_id' => Auth::id(),
            'title' => (string)$this->input('title'),
            'plan_id' => (int)$this->input('plan_id'),
            'images' => (array)$this->input('images', []),
            'video_ids' => (array)$this->input('video_ids', []),
        ];
    }
}
